package com.hrg.seer.sdk.rbk.api;

import lombok.Getter;

import static com.hrg.seer.sdk.rbk.api.MiscApiEnum.*;

@Getter
public enum JackOperationType {
//	ROBOT_OTHER_JACK_LOAD_REQ(6070, "顶升机构上升", 19210),
//	ROBOT_OTHER_JACK_UNLOAD_REQ(6071, "顶升机构下降", 19210),
//	ROBOT_OTHER_JACK_STOP_REQ(6072, "顶升机构停止", 19210),
//	ROBOT_OTHER_JACK_SET_HEIGHT_REQ(6073, "顶升定高", 19210),
	JackLoad(ROBOT_OTHER_JACK_LOAD_REQ, "顶升机构上升", "load", "JackLoad"),
	JackUnload(ROBOT_OTHER_JACK_UNLOAD_REQ, "顶升机构下降", "unload", "JackUnload"),
	JackStop(ROBOT_OTHER_JACK_STOP_REQ, "顶升机构停止", "", "stop"),
	JackSetHeight(ROBOT_OTHER_JACK_SET_HEIGHT_REQ, "顶升定高", "setHeight", "JackHeight"),
	;
	private final MiscApiEnum apiEnum;
	private final String chin;
	private final String operation;
	private final String operationFull;
	JackOperationType(MiscApiEnum apiEnum, String chin, String operation, String operationFull) {
		this.apiEnum = apiEnum;
		this.chin = chin;
		this.operation = operation;
		this.operationFull = operationFull;
	}

	public static JackOperationType getByOperation(String operation) {
		for (JackOperationType value : values()) {
			if (value.operation.equalsIgnoreCase(operation)) {
				return value;
			}
		}
		return null;
	}

	public boolean isLoad() {
		return operation.equalsIgnoreCase("load");
	}

	public boolean isUnload() {
		return operation.equalsIgnoreCase("unload");
	}
}
